#ifndef _IM_AUTO_REPLY_CACHE_H_
#define _IM_AUTO_REPLY_CACHE_H_

#include <stdint.h>
#include <string>
#include <set>
#include <boost/thread/shared_mutex.hpp>

namespace im {

class AutoReplyCache {
public:
  static AutoReplyCache & Instance() {
    static AutoReplyCache cache;
    return cache;
  }

  int Reload();
  std::string GetReply(const std::string & question) const;
private:
  AutoReplyCache();

  AutoReplyCache(const AutoReplyCache &);
  AutoReplyCache& operator=(const AutoReplyCache&);

  std::map<std::string, std::string> qa_map_;
  mutable boost::shared_mutex qa_map_mutex_;
};

}

#endif // _IM_AUTO_REPLY_CACHE_H_
